package com.shop2cn.iapi.wxcomponent.testcase;


import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.wxcomponent.parameter.RefreshComponentAccessTokenBean;
import com.shop2cn.iapi.wxcomponent.service.RefreshComponentAccessTokenCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*获取平台令牌
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_RefreshComponentAccessToken{
	private static RefreshComponentAccessTokenBean refreshcomponentaccesstokenBean;
	private static RefreshComponentAccessTokenCall refreshcomponentaccesstokenCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取平台令牌");
	}

	@Before
	public void caseUp() {
		refreshcomponentaccesstokenBean=new RefreshComponentAccessTokenBean();
		refreshcomponentaccesstokenCall=new RefreshComponentAccessTokenCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(refreshcomponentaccesstokenCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_RefreshComponentAccessToken_001() {
		Logger.start(true,"获取平台令牌");
		try {
			//调用正式环境 只验证返回
			refreshcomponentaccesstokenCall.setData(refreshcomponentaccesstokenBean);
			refreshcomponentaccesstokenCall.callService();			
			Logger.debug(refreshcomponentaccesstokenCall.getStatusCode());
			Logger.verifyEquals(204,refreshcomponentaccesstokenCall.getStatusCode(), "验证返回");
//			Logger.verifyEquals("ok", refreshcomponentaccesstokenCall.getReturnData(), "验证返回");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}